import app
import json


def packaging_assert(response, status_code=200, status=1, msg='登陆成功'):
    assert status_code == response.status_code
    assert status == response.json().get('status')
    assert msg in response.json().get('msg')


def packaging_json():
    test_list = []
    read_json = app.BASE_DIR + '/data/login.json'
    with open(read_json, 'r', encoding='utf-8')as f:
        json_data = json.load(f)
        for case in json_data:
            login_data = case.get('login_data')
            status_code = case.get('status_code')
            status = case.get('status')
            msg = case.get('msg')
            test_list.append((login_data, status_code, status, msg))
        return test_list


if __name__ == '__main__':
    print(packaging_json())
